$(function(){
  $(".login-btn").click (function() {
      // console.log($(".nbzh").val());
      // console.log($(".nbmm").val());
           let zh = $(".nbzh").val()
           let mm = $(".nbmm").val()
      $.get("http://jx.xuzhixiang.top/ap/api/login.php",{
        username:zh,
        password:mm,
      }).then(function(resData){
        console.log(resData);
       if(resData.code == 0){
        // 跳转页面
          alert(resData.msg)

          window.location.href = "";
       }else{ 
          localStorage.setItem("uid", resData.data.id);
          localStorage.setItem("token", resData.data.token);
          alert(resData.msg)
          window.location.href="list.html";
          console.log(resData.data.token);
          console.log(resData.data.id);
       }
        
      })
  });

})